import request from '@/utils/request'

// 查询外呼列表
export function queryIocTaskList(data) {
  return request({
    url: '/admin/iocTask/list',
    method: 'post',
    data,
    params:{
      pageNum:data.pageNum,
      pageSize:data.pageSize,
    }
  })
}

// 创建外呼任务
export function createIocTask(data) {
  return request({
    url: '/admin/iocTask/createIocTask',
    method: 'post',
    data,
  })
}

// 编辑外呼任务
export function editIocTask(data) {
  return request({
    url: '/admin/iocTask/editIocTask',
    method: 'post',
    data,
  })
}

// 获取 bot 枚举
export function queryBotList(params) {
  return request({
    url: '/admin/iocTask/botList',
    method: 'get',
    params,
  })
}

// 获取 外呼线路 枚举
export function queryCallLinkList(params) {
  return request({
    url: '/admin/iocTask/callLinkList',
    method: 'get',
    params,
  })
}

// 查询数字员工
export function queryLeadCoe(params) {
  return request({
    url: '/admin/coeUser/status',
    method: 'get',
    params,
  })
}

// 查询号码库
export function queryLeadList(params) {
  return request({
    url: '/admin/oc/lead/list?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize,
    method: 'post',
    data: params,
  })
}

// 查询 是否客户标签组标签
export function queryCustomerLabelList(params) {
  return request({
    url: '/admin/statistics/customerLabel',
    method: 'get',
    params,
  })
}

// 获取外呼任务详情
export function queryIocTaskInfo(params) {
  return request({
    url: '/admin/iocTask/info',
    method: 'get',
    params,
  })
}

// 获取加人详情
export function queryOcPhoneList(params) {
  return request({
    url: '/admin/oc/phone/list?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize,
    method: 'post',
    data: params,
  })
}

// 号码库上传
export function queryOcLeadAdd(params) {
  return request({
    url: '/admin/oc/lead/add',
    method: 'post',
    timeout: 60 * 1000 * 3,
    data: params,
  })
}

//
export function queryOcLeadListNew(params) {
  return request({
    url: '/admin/oc/lead/distinctList?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize,
    method: 'post',
    timeout: 60 * 1000 * 3,
    data: params,
  })
}

// 开始任务
export function startTask(params){
  return request({
    url: '/admin/iocTask/startTask',
    method: 'get',
    params,
  })
}

// 暂停
export function pauseTask(params){
  return request({
    url: '/admin/iocTask/pauseTask',
    method: 'get',
    params,
  })
}
// 终止
export function terminateTask(params){
  return request({
    url: '/admin/iocTask/terminateTask',
    method: 'get',
    params,
  })
}
// 删除
export function deleteTask(params){
  return request({
    url: '/admin/iocTask/deleteTask',
    method: 'get',
    params,
  })
}

// 任务明细
export function queryDetailList(params){
  return request({
    url: '/admin/iocTask/detail/list',
    method: 'get',
    params,
  })
}

// 二次外呼任务明细
export function queryReDetailList(params){
  return request({
    url: '/admin/iocTask/detail/relist',
    method: 'get',
    params,
  })
}

// 发送引流链接
export function sendHkLink(params){
  return request({
    url: '/admin/iocTask/sendHkLink',
    method: 'get',
    params,
  })
}

// 重新添加
export function sendWxAdd(params){
  return request({
    url: '/admin/iocTask/sendWxAdd',
    method: 'get',
    params,
  })
}
